<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pygeoip.GeoIP</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pygeoip-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/pygeoip/">pygeoip</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pygeoip-module.html">Package&nbsp;pygeoip</a> ::
        Class&nbsp;GeoIP
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pygeoip.GeoIP-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class GeoIP</h1><p class="nomargin-top"><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP">source&nbsp;code</a></span></p>
<pre class="base-tree">
object --+    
         |    
 <a href="pygeoip.GeoIPBase-class.html">GeoIPBase</a> --+
             |
            <strong class="uidshort">GeoIP</strong>
</pre>

<hr />
<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">filename</span>,
        <span class="summary-sig-arg">flags</span>=<span class="summary-sig-default">0</span>)</span><br />
      Initialize the class.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="_setup_segments"></a><span class="summary-sig-name">_setup_segments</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Parses the database file to determine what kind of database is being 
      used and setup segment sizes and start points that will be used by 
      the seek*() methods later.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP._setup_segments">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">int</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#_lookup_country_id" class="summary-sig-name" onclick="show_private();">_lookup_country_id</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">addr</span>)</span><br />
      Get the country index.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP._lookup_country_id">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">int</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#_seek_country" class="summary-sig-name" onclick="show_private();">_seek_country</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">ipnum</span>)</span><br />
      Using the record length and appropriate start points, seek to the 
      country that corresponds to the converted IP address integer.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP._seek_country">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">str</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#_get_org" class="summary-sig-name" onclick="show_private();">_get_org</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">ipnum</span>)</span><br />
      Seek and return organization (or ISP) name for converted IP addr.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP._get_org">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">dict</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#_get_region" class="summary-sig-name" onclick="show_private();">_get_region</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">ipnum</span>)</span><br />
      Seek and return the region info (dict containing country_code and 
      region_name).</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP._get_region">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">dict</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#_get_record" class="summary-sig-name" onclick="show_private();">_get_record</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">ipnum</span>)</span><br />
      Populate location dict for converted IP.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP._get_record">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">str</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#country_code_by_addr" class="summary-sig-name">country_code_by_addr</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">addr</span>)</span><br />
      Returns 2-letter country code (e.g.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.country_code_by_addr">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">str</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#country_code_by_name" class="summary-sig-name">country_code_by_name</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">hostname</span>)</span><br />
      Returns 2-letter country code (e.g.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.country_code_by_name">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">str</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#country_name_by_addr" class="summary-sig-name">country_name_by_addr</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">addr</span>)</span><br />
      Returns full country name for specified IP address.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.country_name_by_addr">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">str</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#country_name_by_name" class="summary-sig-name">country_name_by_name</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">hostname</span>)</span><br />
      Returns full country name for specified hostname.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.country_name_by_name">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">str</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#org_by_addr" class="summary-sig-name">org_by_addr</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">addr</span>)</span><br />
      Lookup the organization (or ISP) for given IP address.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.org_by_addr">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">str</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#org_by_name" class="summary-sig-name">org_by_name</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">hostname</span>)</span><br />
      Lookup the organization (or ISP) for hostname.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.org_by_name">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">dict</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#record_by_addr" class="summary-sig-name">record_by_addr</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">addr</span>)</span><br />
      Look up the record for a given IP address.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.record_by_addr">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">dict</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#record_by_name" class="summary-sig-name">record_by_name</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">hostname</span>)</span><br />
      Look up the record for a given hostname.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.record_by_name">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">dict</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#region_by_addr" class="summary-sig-name">region_by_addr</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">addr</span>)</span><br />
      Lookup the region for given IP address.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.region_by_addr">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">dict</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#region_by_name" class="summary-sig-name">region_by_name</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">hostname</span>)</span><br />
      Lookup the region for given hostname.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.region_by_name">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__str__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Properties</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Properties"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">filename</span>,
        <span class="sig-arg">flags</span>=<span class="sig-default">0</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Initialize the class.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>filename</code></strong> (str) - path to a geoip database</li>
        <li><strong class="pname"><code>flags</code></strong> (int) - flags that affect how the database is processed. Currently the 
          only supported flags are STANDARD, MEMORY_CACHE, and MMAP_CACHE.</li>
    </ul></dd>
    <dt>Overrides:
        object.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="_lookup_country_id"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_lookup_country_id</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">addr</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP._lookup_country_id">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Get the country index.</p>
  <p>This method is called by the _lookupCountryCode and _lookupCountryName
  methods. It looks up the index ('id') for the country which is the key 
  for the code and name.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>addr</code></strong> (str) - The IP address</li>
    </ul></dd>
    <dt>Returns: int</dt>
        <dd>network byte order 32-bit integer</dd>
  </dl>
</td></tr></table>
</div>
<a name="_seek_country"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_seek_country</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">ipnum</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP._seek_country">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Using the record length and appropriate start points, seek to the 
  country that corresponds to the converted IP address integer.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>ipnum</code></strong> (int) - result of ip2long conversion</li>
    </ul></dd>
    <dt>Returns: int</dt>
        <dd>offset of start of record</dd>
  </dl>
</td></tr></table>
</div>
<a name="_get_org"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_get_org</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">ipnum</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP._get_org">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Seek and return organization (or ISP) name for converted IP addr.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>ipnum</code></strong> (int) - Converted IP address</li>
    </ul></dd>
    <dt>Returns: str</dt>
        <dd>org/isp name</dd>
  </dl>
</td></tr></table>
</div>
<a name="_get_region"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_get_region</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">ipnum</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP._get_region">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Seek and return the region info (dict containing country_code and 
  region_name).</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>ipnum</code></strong> (int) - converted IP address</li>
    </ul></dd>
    <dt>Returns: dict</dt>
        <dd>dict containing country_code and region_name</dd>
  </dl>
</td></tr></table>
</div>
<a name="_get_record"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_get_record</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">ipnum</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP._get_record">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Populate location dict for converted IP.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>ipnum</code></strong> (int) - converted IP address</li>
    </ul></dd>
    <dt>Returns: dict</dt>
        <dd>dict with country_code, country_code3, country_name, region, 
          city, postal_code, latitude, longitude, dma_code, metro_code, 
          area_code, region_name, time_zone</dd>
  </dl>
</td></tr></table>
</div>
<a name="country_code_by_addr"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">country_code_by_addr</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">addr</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.country_code_by_addr">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns 2-letter country code (e.g. 'US') for specified IP address. 
  Use this method if you have a Country, Region, or City database.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>addr</code></strong> (str) - IP address</li>
    </ul></dd>
    <dt>Returns: str</dt>
        <dd>2-letter country code</dd>
  </dl>
</td></tr></table>
</div>
<a name="country_code_by_name"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">country_code_by_name</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">hostname</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.country_code_by_name">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns 2-letter country code (e.g. 'US') for specified hostname. Use 
  this method if you have a Country, Region, or City database.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>hostname</code></strong> (str) - host name</li>
    </ul></dd>
    <dt>Returns: str</dt>
        <dd>2-letter country code</dd>
  </dl>
</td></tr></table>
</div>
<a name="country_name_by_addr"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">country_name_by_addr</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">addr</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.country_name_by_addr">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns full country name for specified IP address. Use this method if
  you have a Country or City database.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>addr</code></strong> (str) - IP address</li>
    </ul></dd>
    <dt>Returns: str</dt>
        <dd>country name</dd>
  </dl>
</td></tr></table>
</div>
<a name="country_name_by_name"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">country_name_by_name</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">hostname</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.country_name_by_name">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns full country name for specified hostname. Use this method if 
  you have a Country database.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>hostname</code></strong> (str) - host name</li>
    </ul></dd>
    <dt>Returns: str</dt>
        <dd>country name</dd>
  </dl>
</td></tr></table>
</div>
<a name="org_by_addr"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">org_by_addr</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">addr</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.org_by_addr">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Lookup the organization (or ISP) for given IP address. Use this method
  if you have an Organization/ISP database.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>addr</code></strong> (str) - IP address</li>
    </ul></dd>
    <dt>Returns: str</dt>
        <dd>organization or ISP name</dd>
  </dl>
</td></tr></table>
</div>
<a name="org_by_name"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">org_by_name</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">hostname</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.org_by_name">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Lookup the organization (or ISP) for hostname. Use this method if you 
  have an Organization/ISP database.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>hostname</code></strong> (str) - host name</li>
    </ul></dd>
    <dt>Returns: str</dt>
        <dd>organization or ISP name</dd>
  </dl>
</td></tr></table>
</div>
<a name="record_by_addr"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">record_by_addr</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">addr</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.record_by_addr">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Look up the record for a given IP address. Use this method if you have
  a City database.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>addr</code></strong> (str) - IP address</li>
    </ul></dd>
    <dt>Returns: dict</dt>
        <dd>dict with country_code, country_code3, country_name, region, 
          city, postal_code, latitude, longitude, dma_code, metro_code, 
          area_code, region_name, time_zone</dd>
  </dl>
</td></tr></table>
</div>
<a name="record_by_name"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">record_by_name</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">hostname</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.record_by_name">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Look up the record for a given hostname. Use this method if you have a
  City database.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>hostname</code></strong> (str) - host name</li>
    </ul></dd>
    <dt>Returns: dict</dt>
        <dd>dict with country_code, country_code3, country_name, region, 
          city, postal_code, latitude, longitude, dma_code, metro_code, 
          area_code, region_name, time_zone</dd>
  </dl>
</td></tr></table>
</div>
<a name="region_by_addr"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">region_by_addr</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">addr</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.region_by_addr">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Lookup the region for given IP address. Use this method if you have a 
  Region database.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>addr</code></strong> (str) - IP address</li>
    </ul></dd>
    <dt>Returns: dict</dt>
        <dd>dict containing country_code, region, and region_name</dd>
  </dl>
</td></tr></table>
</div>
<a name="region_by_name"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">region_by_name</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">hostname</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.region_by_name">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Lookup the region for given hostname. Use this method if you have a 
  Region database.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>hostname</code></strong> (str) - host name</li>
    </ul></dd>
    <dt>Returns: dict</dt>
        <dd>dict containing country_code, region, and region_name</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pygeoip-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/pygeoip/">pygeoip</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Oct 14 13:02:47 2010
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
